package cn.itcast.day08.demo06;

public class DemoMain {
    public static void main(String[] args) {
        Hero hero=new Hero();
        hero.setName("盖伦");
        hero.setAge(20);
        Weapon weapon=new Weapon("无尽之刃");
        hero.setWeapon(weapon);
        System.out.println("姓名:"+hero.getName()+",年龄:"+hero.getAge()+",武器:"+hero.getWeapon().getCode());
        hero.attack();
    }
}
